import http from "@/utils/request";
import api from '@/utils/request1'//服务器
export const getMenu=(params)=>{
   return http.post('/permission/getMenu',params)
}
//请求首页数据
export const getData=(url,config)=>{
    //返回一个Promise对象
    return http.get('/home/getData')
}
//添加用户
export const addUser=(data)=>{
    return http.post('/user/add',data)
}
//用户列表
export const getUserList=(conf)=>{
    return http.get('/user/getUserList',conf)
}
//删除用户
export const deleteUser=(data)=>{
    return http.post('/user/delete',data)
}
//更新用户信息
export const updateUser=(data)=>{
    return http.post('/user/update',data)
}

//获取所有图书信息
export const getAllBook=()=>{
    return api.get('/bookList')
}
// 根据ID获取图书详情
export const getDetailById=id=>{
    return http.get('/book/getDetail',id)
}
//图书更新
//删除
export const deleteBook=(params)=>{
    return api.delete('/bookList',params)
}
// 添加
export const addBook=(data)=>{
    return api.post('/bookList',data)
}
//登录
export const userLogin=(data)=>{
    return api.post('/userLogin',data)
}
export  const updateBook=data=>{
    return api.put('/bookList',data)
}